package com.car.serve.controller;


import cn.hutool.core.bean.BeanUtil;
import com.car.commons.core.model.Result;
import com.car.serve.entity.InfoProject;
import com.car.serve.entity.ServeProject;
import com.car.serve.service.InfoProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 董旭
 * @since 2024-08-28
 */
@RestController
@RequestMapping("/infoProject")
@Api(tags = "项目服务关联信息")
public class InfoProjectController {
    @Resource
    private InfoProjectService infoProjectService;


    @GetMapping("/findById")
    @ApiOperation(value = "根据服务Id查询项目集合")
    public Result<List<InfoProject>>findById(Integer serveId)throws Exception{
        List<InfoProject> byId = infoProjectService.findById(serveId);
        return Result.getListResult(InfoProject.class).setMsg("查询成功").setData(BeanUtil.copyToList(byId,InfoProject.class));
    }



}

